#ifndef _GLOBALREFLECTION_H_
#define _GLOBALREFLECTION_H_
#include "gDefine.h"

enum EDefGroup
{
	eDefGroup_Default=0,
	eDefGroup_Affectors,
	eDefGroup_EventConditons,
	eDefGroup_GameEvents,
};
enum EDefaultDef
{
	eDefaultDef_Affections,
	eDefaultDef_Reactors,
	eDefaultDef_Selectors,
	eDefaultDef_SelectRules,
	eDefaultDef_Validators,
	eDefaultDef_ValidatorSkill,
	eDefaultDef_ValidatorObj,
	eDefaultDef_ValidatorEach,
	eDefaultDef_ValidatorContext,
	eDefaultDef_ReactorTypes,
	eDefaultDef_LocalizeDic,
	eDefaultDef_CardTypes,
	eDefaultDef_Card,
	eDefaultDef_ShopItem,
	eDefaultDef_ShopFunction,
	eDefaultDef_Gamble,
	eDefaultDef_HeroCard,
	eDefaultDef_HeroTypes,
	eDefaultDef_CardLevelUpExp,
	eDefaultDef_CombatPower,
	eDefaultDef_Buff,
	eDefaultDef_BuffType,
	eDefaultDef_CombatPowerAddon,
	eDefaultDef_RageInc,
	eDefaultDef_SignInReward,
	eDefaultDef_Friend,
	eDefaultDef_FriendLvlCount,
	eDefaultDef_InnateSkill,
	eDefaultDef_ReactorCategory,
	eDefaultDef_Formula,
	eDefaultDef_Operator,
	eDefaultDef_SpecialCardPiecesConfig,
	eDefaultDef_DropCounter,
	eDefaultDef_HeroRageInc,
	eDefaultDef_TableFilter,
	eDefaultDef_TableList,
	eDefaultDef_DropSource,
	eDefaultDef_CustomCombatDef,
	eDefaultDef_CombatDataDef,
	eDefaultDef_DailyQuest,
	eDefaultDef_AchiveCounter,
	eDefaultDef_ClassList,
	eDefaultDef_AchievePoint,
	eDefaultDef_AchieveSeries,
	eDefaultDef_LadderBuff,
	eDefaultDef_CollectForumal,
	eDefaultDef_CollectActvity,
	eDefaultDef_OnlineAddBuffActivity,
	eDefaultDef_PlunderHonorDrop,
	eDefaultDef_NewbieCourseSavePoint,
	eDefaultDef_GlobalConfigDef,
	eDefaultDef_NewRankRewardDef,
	eDefaultDef_TounamentRobotDef,
	eDefaultDef_ZetaTauriPieceDef,
	eDefaultDef_DailyTaskAwards,
	eDefaultDef_SecretShopDef,
	eDefaultDef_SectetItemPrizeDef,
	eDefaultDef_CombatHurtHero,
	eDefaultDef_DropBoxDesc,
	eDefaultDef_ReactorDefString,
	eDefaultDef_CursadeNodeDef,
	eDefaultDef_CursadeSearchRule,
	eDefaultDef_CursadeReliveRule,
	eDefaultDef_Num,
};

#define MakeClassID(iGroupID,iSubID) (iGroupID*10000+iSubID)
class CClass;
class GlobalClassManager
{
public:
	static  GlobalClassManager& Instance()
	{
		static GlobalClassManager _instance;
		return _instance;
	}
	bool RegisterClass(CClass& rClass,int32 iSubID,int32 iGroupID=0);

	const CClass* LookupClass(int32 iGroup,int32 iSubID);
	const CClass* LookupClass(int32 iID);
	
	void EnumerateClasses(std::vector<const CClass*>& vClasses);
	
private:
	GlobalClassManager(){}
	std::map<int32,const CClass*> m_mClasses;
};


#endif //_GLOBALDEFMANAGER_H_